<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//计算n！
			function jcen(n)
			{
				var result= 0;
				for (var i=1;i<=n;i++) {
					result +=i;
				}
				return result;
			}
			document.write(jcen(100)+"<br/>");
			
			function jcen2(n)
			{
				var result= 1;
				for (var i=1;i<=n;i++) {
					result *=i;
				}
				return result;
			}
			document.write(jcen2(10)+"<br/>");
			
			function jcen3(n)
			{
				if(n>1)
			 {
				return n*jcen3(n-1);
				}else{
					return 1;
				}
				
			}
			document.write(jcen3(10)+"<br/>");
			
			//练习2计算菲薄那锲  1 1 2 3 5 8 13 21 34 55 ....
			function febo(i){
				if (i>=3) {
					return febo(i-1)+febo(i-2);
				} else{
					return 1;
				}
			}
			for (var i=1;i<=10;i++) {
				document.write(febo(i)+"&nbsp;");
			}
			
		</script>
	</body>
</html>
